\(\int \frac {\sin ^4(x)}{i+\cot (x)} \, dx\) [1]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 78 \[ \int \frac {\sin ^4(x)}{i+\cot (x)} \, dx=-\frac {5 i x}{16}+\frac {1}{32 (i-\cot (x))^2}-\frac {i}{8 (i-\cot (x))}-\frac {i}{24 (i+\cot (x))^3}-\frac {3}{32 (i+\cot (x))^2}+\frac {3 i}{16 (i+\cot (x))} \]

[Out]

-5/16*I*x+1/32/(I-cot(x))^2-1/8*I/(I-cot(x))-1/24*I/(I+cot(x))^3-3/32/(I+cot(x))^2+3/16*I/(I+cot(x))

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3568, 46, 209} \[ \int \frac {\sin ^4(x)}{i+\cot (x)} \, dx=-\frac {5 i x}{16}-\frac {i}{8 (-\cot (x)+i)}+\frac {3 i}{16 (\cot (x)+i)}+\frac {1}{32 (-\cot (x)+i)^2}-\frac {3}{32 (\cot (x)+i)^2}-\frac {i}{24 (\cot (x)+i)^3} \]

[In]

Int[Sin[x]^4/(I + Cot[x]),x]

[Out]

((-5*I)/16)*x + 1/(32*(I - Cot[x])^2) - (I/8)/(I - Cot[x]) - (I/24)/(I + Cot[x])^3 - 3/(32*(I + Cot[x])^2) + (
(3*I)/16)/(I + Cot[x])

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1}{(i-x)^3 (i+x)^4} \, dx,x,\cot (x)\right ) \\ & = \text {Subst}\left (\int \left (-\frac {1}{16 (-i+x)^3}-\frac {i}{8 (-i+x)^2}+\frac {i}{8 (i+x)^4}+\frac {3}{16 (i+x)^3}-\frac {3 i}{16 (i+x)^2}+\frac {5 i}{16 \left (1+x^2\right )}\right ) \, dx,x,\cot (x)\right ) \\ & = \frac {1}{32 (i-\cot (x))^2}-\frac {i}{8 (i-\cot (x))}-\frac {i}{24 (i+\cot (x))^3}-\frac {3}{32 (i+\cot (x))^2}+\frac {3 i}{16 (i+\cot (x))}+\frac {5}{16} i \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\cot (x)\right ) \\ & = -\frac {5 i x}{16}+\frac {1}{32 (i-\cot (x))^2}-\frac {i}{8 (i-\cot (x))}-\frac {i}{24 (i+\cot (x))^3}-\frac {3}{32 (i+\cot (x))^2}+\frac {3 i}{16 (i+\cot (x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.19 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.65 \[ \int \frac {\sin ^4(x)}{i+\cot (x)} \, dx=\frac {1}{192} (-15 \cos (2 x)+6 \cos (4 x)-i (60 x-i \cos (6 x)-45 \sin (2 x)+9 \sin (4 x)-\sin (6 x))) \]

[In]

Integrate[Sin[x]^4/(I + Cot[x]),x]

[Out]

(-15*Cos[2*x] + 6*Cos[4*x] - I*(60*x - I*Cos[6*x] - 45*Sin[2*x] + 9*Sin[4*x] - Sin[6*x]))/192

Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.50

method result size
risch \(-\frac {5 i x}{16}-\frac {{\mathrm e}^{-6 i x}}{192}+\frac {\cos \left (4 x \right )}{32}-\frac {3 i \sin \left (4 x \right )}{64}-\frac {5 \cos \left (2 x \right )}{64}+\frac {15 i \sin \left (2 x \right )}{64}\) \(39\)
default \(\frac {i}{2 \tan \left (x \right )-2 i}-\frac {i}{24 \left (\tan \left (x \right )-i\right )^{3}}-\frac {7}{32 \left (\tan \left (x \right )-i\right )^{2}}-\frac {5 \ln \left (\tan \left (x \right )-i\right )}{32}+\frac {3 i}{16 \left (\tan \left (x \right )+i\right )}+\frac {1}{32 \left (\tan \left (x \right )+i\right )^{2}}+\frac {5 \ln \left (\tan \left (x \right )+i\right )}{32}\) \(66\)

[In]

int(sin(x)^4/(I+cot(x)),x,method=_RETURNVERBOSE)

[Out]

-5/16*I*x-1/192*exp(-6*I*x)+1/32*cos(4*x)-3/64*I*sin(4*x)-5/64*cos(2*x)+15/64*I*sin(2*x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.50 \[ \int \frac {\sin ^4(x)}{i+\cot (x)} \, dx=\frac {1}{384} \, {\left (-120 i \, x e^{\left (6 i \, x\right )} - 3 \, e^{\left (10 i \, x\right )} + 30 \, e^{\left (8 i \, x\right )} - 60 \, e^{\left (4 i \, x\right )} + 15 \, e^{\left (2 i \, x\right )} - 2\right )} e^{\left (-6 i \, x\right )} \]

[In]

integrate(sin(x)^4/(I+cot(x)),x, algorithm="fricas")

[Out]

1/384*(-120*I*x*e^(6*I*x) - 3*e^(10*I*x) + 30*e^(8*I*x) - 60*e^(4*I*x) + 15*e^(2*I*x) - 2)*e^(-6*I*x)

Sympy [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.69 \[ \int \frac {\sin ^4(x)}{i+\cot (x)} \, dx=- \frac {5 i x}{16} - \frac {e^{4 i x}}{128} + \frac {5 e^{2 i x}}{64} - \frac {5 e^{- 2 i x}}{32} + \frac {5 e^{- 4 i x}}{128} - \frac {e^{- 6 i x}}{192} \]

[In]

integrate(sin(x)**4/(I+cot(x)),x)

[Out]

-5*I*x/16 - exp(4*I*x)/128 + 5*exp(2*I*x)/64 - 5*exp(-2*I*x)/32 + 5*exp(-4*I*x)/128 - exp(-6*I*x)/192

Maxima [F(-2)]

Exception generated. \[ \int \frac {\sin ^4(x)}{i+\cot (x)} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate(sin(x)^4/(I+cot(x)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.81 \[ \int \frac {\sin ^4(x)}{i+\cot (x)} \, dx=\frac {15 \, \tan \left (x\right )^{2} + 18 i \, \tan \left (x\right ) - 5}{64 \, {\left (-i \, \tan \left (x\right ) + 1\right )}^{2}} + \frac {55 \, \tan \left (x\right )^{3} - 69 i \, \tan \left (x\right )^{2} - 15 \, \tan \left (x\right ) - 7 i}{192 \, {\left (\tan \left (x\right ) - i\right )}^{3}} + \frac {5}{32} \, \log \left (\tan \left (x\right ) + i\right ) - \frac {5}{32} \, \log \left (\tan \left (x\right ) - i\right ) \]

[In]

integrate(sin(x)^4/(I+cot(x)),x, algorithm="giac")

[Out]

1/64*(15*tan(x)^2 + 18*I*tan(x) - 5)/(-I*tan(x) + 1)^2 + 1/192*(55*tan(x)^3 - 69*I*tan(x)^2 - 15*tan(x) - 7*I)
/(tan(x) - I)^3 + 5/32*log(tan(x) + I) - 5/32*log(tan(x) - I)

Mupad [B] (verification not implemented)

Time = 12.56 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.62 \[ \int \frac {\sin ^4(x)}{i+\cot (x)} \, dx=-\frac {x\,5{}\mathrm {i}}{16}+\frac {\frac {11\,{\mathrm {tan}\left (x\right )}^4}{16}-\frac {{\mathrm {tan}\left (x\right )}^3\,3{}\mathrm {i}}{16}+\frac {31\,{\mathrm {tan}\left (x\right )}^2}{48}-\frac {\mathrm {tan}\left (x\right )\,7{}\mathrm {i}}{48}+\frac {1}{6}}{{\left (\mathrm {tan}\left (x\right )+1{}\mathrm {i}\right )}^2\,{\left (1+\mathrm {tan}\left (x\right )\,1{}\mathrm {i}\right )}^3} \]

[In]

int(sin(x)^4/(cot(x) + 1i),x)

[Out]

((31*tan(x)^2)/48 - (tan(x)*7i)/48 - (tan(x)^3*3i)/16 + (11*tan(x)^4)/16 + 1/6)/((tan(x) + 1i)^2*(tan(x)*1i +
1)^3) - (x*5i)/16